package com.work.cos.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.work.cos.domain.entity.UserEntity;
import com.work.cos.domain.entity.pr.PrOrderEntity;
import com.work.cos.domain.vo.ComServiceResVo;
import com.work.cos.service.interfc.ICosDistriService;
import com.work.cos.service.interfc.IUserService;
import com.work.cos.service.interfc.pr.IPrOrderService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author stylefeng123
 */
@Service
public class CosDistriServiceImpl implements ICosDistriService {

	@Autowired
	private IUserService userService;  //cos user
	@Autowired
	private IPrOrderService orderService; //cos order
	
	@Override
	public ComServiceResVo getOrderEndDisTriCheck(String orderId, String userId) {
		
		UserEntity userEntity = userService.findUsersByUserId(Long.parseLong(userId));
		PrOrderEntity orderEntity = orderService.getListByUserIdAndId(userId, Long.parseLong(orderId));
		
		//user base type(0) && order money && order have product type
		if(true){
			
			//profit
			
			//update user base type
		}
		
		//update order end
		return ComServiceResVo.returnSuccessStatus();
	}

}
